package action.chap5;

import java.util.Arrays;
import java.util.List;

/**
 *规约可以元素求和， 分为有初始值和无初始值a
 */
public class Demo540 {
    public static void main(String[] args) {
        List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
        Integer reduce = numbers.stream().reduce(1,  (a, b) -> a * b);
        System.out.println(reduce);
    }
}
